<template>
  <div>
    <div>
    <h2>申请人：{{form.userName}}</h2>
    <el-form  label-width="80px">
      <el-form-item label="申请类型" >
       <el-input v-model="form.taskCategoryName"/>
      </el-form-item>
      <el-form-item label="标题">
        <el-input v-model="form.taskCategoryName"/>
      </el-form-item>
      <el-form-item label="原因" >
        <el-input v-model="form.remark" />
      </el-form-item>
      <el-form-item label="开始时间">
        <el-input v-model="form.createTime"/>
      </el-form-item>
      <el-form-item label="结束时间">
        <el-input v-model="form.endTime"/>
      </el-form-item>
    </el-form>
    </div>
    <div  v-for="(historyTaskResModel, index) in fromData"
          :key="index" >
      <h2>{{historyTaskResModel.taskNodeName}}</h2>
      <h3>审批人:{{historyTaskResModel.createName}}</h3>
      <h3>审批时间:{{historyTaskResModel.createdDate}}</h3>
      <el-form v-for="(formDataResModel, indexH) in historyTaskResModel.formDataResModelList" :key="indexH" label-width="80px">
        <el-form-item :label=formDataResModel.title >
          <el-input v-model="formDataResModel.value"/>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>

<script>
  import { taskDetail } from '@/api/task/task'
  import { historyFromData } from '@/api/activiti/history'
  export default {
    name: "historyForm",
    props: {
      businessKey: {
        type: String
      }
    },
    data(){
      return{
        // 表单参数
        form: {},
        fromData:[],
      }
    },
    created() {
      this.taskDetail()
      this.historyFromData()
    },
    methods:{
      taskDetail() {
        taskDetail(this.businessKey).then(response => {
          this.form = response.data
          console.info("form：：：：：：："+this.form)
        })
      },
      historyFromData() {
        historyFromData(this.businessKey).then(response => {
          this.fromData = response.data
        })
      },
    }

  }
</script>

<style scoped>

</style>
